package com.ruoyi.manager.service.impl;

import com.ruoyi.manager.mapper.TeacherAnalysisMapper;
import com.ruoyi.manager.service.TeachAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class TeachAnalysisServiceImpl implements TeachAnalysisService {

    @Autowired
    TeacherAnalysisMapper teacherAnalysisMapper;

    @Override
    public List<Map<String, Object>> listClassesInfor() {
        return teacherAnalysisMapper.listClassesInfor();
    }


    //考核情况分析-饼图
    @Override
    public List<Map<String, Object>> assessmentAnalysisPie() {
        return teacherAnalysisMapper.assessmentAnalysisPie();
    }


    //考核情况分析-饼图
    @Override
    public List<Map<String, Object>> assessmentAnalysisfunnel() {
        return teacherAnalysisMapper.assessmentAnalysisfunnel();
    }

    /**
     *      作业情况分析-完成率、提交率、完成率低于40%占比、完成率高于80%占比
     * @return
     */
    @Override
    public Map<String, Object> exRate() {

        Map<String,Object> map1 = teacherAnalysisMapper.allFinish();
        Map<String,Object> map2 = teacherAnalysisMapper.allSubmit();
        Map<String,Object> map3 = teacherAnalysisMapper.lt40();
        Map<String,Object> map4 = teacherAnalysisMapper.gt80();
        map1.putAll(map2);
        map1.putAll(map3);
        map1.putAll(map4);
        return map1;
    }

    /**
     *     作业情况分析-柱状图
     */
    @Override
    public List<Map<String, Object>> classSubAndFin() {
        return teacherAnalysisMapper.classSubAndFin();
    }

    /**
     *     本周核心作业完成率低于40%学员列表
     */
    @Override
    public List<Map<String, Object>> studentsLt40() {
        return teacherAnalysisMapper.studentsLt40();
    }
    /**
     *     所有在训班级当周总成绩和平均成绩
     */
    @Override
    public Map<String, Object> countScoreAndAvg() {
        System.out.println("********/*********************"+teacherAnalysisMapper.countScoreAndAvg()+"********/*********************");
        return teacherAnalysisMapper.countScoreAndAvg();
    }

    /**
     *     当周项目经理发布作业次数
     */
    @Override
    public List<Map<String, Object>> homeworkPublishTimes() {
        return teacherAnalysisMapper.homeworkPublishTimes();
    }

    @Override
    public List<Map<String, Object>> assessMent() {
        return teacherAnalysisMapper.assessMent();
    }

    @Override
    public List<Map<String, Object>> distriBution() {
        return teacherAnalysisMapper.distriBution();
    }
}
